
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>5.vue规范 · 邦德前端开发</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        <meta name="author" content="i@ickeep.com">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-diy-introduction/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="6.前后端数据交互说明.html" />
    
    
    <link rel="prev" href="4.ESlint检测规则说明.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://2017hcb.bond520.com/pc/index.html" target="_blank" class="custom-link">邦德官网</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">开发说明</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">前端规范</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="1.HTML.html">
            
                <a href="1.HTML.html">
            
                    
                    1.HTML
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2.CSS.html">
            
                <a href="2.CSS.html">
            
                    
                    2.CSS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="3.JavaScript.html">
            
                <a href="3.JavaScript.html">
            
                    
                    3.JavaScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="4.ESlint检测规则说明.html">
            
                <a href="4.ESlint检测规则说明.html">
            
                    
                    4.ESlint 检测规则说明
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.5" data-path="5.vue规范.html">
            
                <a href="5.vue规范.html">
            
                    
                    5.vue规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="6.前后端数据交互说明.html">
            
                <a href="6.前后端数据交互说明.html">
            
                    
                    6.前后端数据交互说明
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">常见问题</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../3.常见问题/常见问题.html">
            
                <a href="../3.常见问题/常见问题.html">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >5.vue规范</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="vue&#x4F7F;&#x7528;&#x89C4;&#x8303;"><a name="vue&#x4F7F;&#x7528;&#x89C4;&#x8303;" class="plugin-anchor" href="#vue&#x4F7F;&#x7528;&#x89C4;&#x8303;"><i class="fa fa-link" aria-hidden="true"></i></a>vue&#x4F7F;&#x7528;&#x89C4;&#x8303;</h1>
<h2 id="&#x547D;&#x540D;"><a name="&#x547D;&#x540D;" class="plugin-anchor" href="#&#x547D;&#x540D;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x547D;&#x540D;</h2>
<ol>
<li>&#x7EC4;&#x4EF6;&#x540D;&#x79F0;&#xFF08;&#x5305;&#x62EC;&#x8DEF;&#x7531;&#x7EC4;&#x4EF6;&#xFF09;&#x4F7F;&#x7528;&quot;-&quot;&#x6765;&#x5206;&#x5272;&#xFF0C;&#x6BD4;&#x5982;persons-new-poi.vue&#xFF0C;&#x4E0D;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x9A7C;&#x5CF0;&#xFF0C;&#x8BE6;&#x89C1; <a href="https://cn.vuejs.org/v2/guide/components.html#&#x7EC4;&#x4EF6;&#x547D;&#x540D;&#x7EA6;&#x5B9A;" target="_blank">&#x7EC4;&#x4EF6;&#x547D;&#x540D;&#x89C4;&#x8303;</a></li>
<li>&#x4E8B;&#x4EF6;&#x7684;&#x540D;&#x79F0;&#x4E5F;&#x4F7F;&#x7528;&quot;-&quot;&#x6765;&#x5206;&#x5272;&#xFF0C;&#x800C;&#x4E14;&#x524D;&#x7F00;&#x4E3A;on-&#xFF0C; &#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x9A7C;&#x5CF0;&#x3002;</li>
<li>&#x5F02;&#x6B65;&#x8BF7;&#x6C42;&#x6570;&#x636E;&#x7EDF;&#x4E00;&#x4E3A; xxxData &#x4E14;&#x7EDF;&#x4E00;&#x4F7F;&#x7528; fetchData&#x83B7;&#x53D6;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x9700;&#x8981;&#x5728;then()&#x91CC;&#x505A;&#x5176;&#x4ED6;&#x5904;&#x7406;&#x6216;&#x8005;&#x64CD;&#x4F5C;&#xFF0C;&#x7EDF;&#x4E00;&#x4F7F;&#x7528; async await <pre class="language-"><code class="lang-javascript"><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
 <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
   <span class="token keyword">return</span> <span class="token punctuation">{</span>
     liveData<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
   <span class="token punctuation">}</span>
 <span class="token punctuation">}</span><span class="token punctuation">,</span>
 <span class="token function">created</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
   <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">fetchData</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">,</span>
 methods<span class="token punctuation">:</span> <span class="token punctuation">{</span>
   <span class="token keyword">async</span> <span class="token function">fetchData</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
     <span class="token keyword">this</span><span class="token punctuation">.</span>liveData <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$httpGet</span><span class="token punctuation">(</span><span class="token string">&apos;/api/live&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> id<span class="token punctuation">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span>$route<span class="token punctuation">.</span>params<span class="token punctuation">.</span>id <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">}</span>
 <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
</li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; doc.ickeep.com 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2017-03-10 21:25:48
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="4.ESlint检测规则说明.html" class="navigation navigation-prev " aria-label="Previous page: 4.ESlint 检测规则说明">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="6.前后端数据交互说明.html" class="navigation navigation-next " aria-label="Next page: 6.前后端数据交互说明">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"5.vue规范","level":"2.5","depth":1,"next":{"title":"6.前后端数据交互说明","level":"2.6","depth":1,"path":"2.前端规范/6.前后端数据交互说明.md","ref":"2.前端规范/6.前后端数据交互说明.md","articles":[]},"previous":{"title":"4.ESlint 检测规则说明","level":"2.4","depth":1,"path":"2.前端规范/4.ESlint检测规则说明.md","ref":"2.前端规范/4.ESlint检测规则说明.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","prism","-highlight","search-plus","tbfed-pagefooter","expandable-chapters-small","anchors","edit-link","diy-introduction","sitemap-general","livereload"],"root":"./docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy doc.ickeep.com 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"introduction-text":"开发说明","prism":{},"livereload":{},"sitemap-general":{"prefix":"https://doc.ickeep.com"},"fontsettings":{"theme":"white","family":"sans","size":2},"fontSettings":{"theme":"night","family":"sans","size":2},"diy-introduction":{},"favicon":{"shortcut":"/assets/img/favicon.ico","bookmark":"/assets/img/favicon.ico","appleTouch":"/assets/img/apple-touch-icon.png","appleTouchMore":{"120x120":"/assets/img/apple-touch-icon-120x120.png","180x180":"/assets/img/apple-touch-icon-180x180.png"}},"expandable-chapters-small":{},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["facebook","google","twitter","instapaper","instapaper"]},"edit-link":{"label":"编辑此页","base":"https://git.oschina.net/ickeep/dev-doc.git/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"search-plus":{}},"theme":"default","author":"i@ickeep.com","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.MD","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"邦德前端开发","language":"zh-hans","links":{"sidebar":{"邦德官网":"http://2017hcb.bond520.com/pc/index.html"}},"gitbook":"*","description":"邦德前端开发文档"},"file":{"path":"2.前端规范/5.vue规范.md","mtime":"2017-03-10T13:25:48.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-10T13:25:56.104Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

